package de.nordakademie.wpk.boerse.ui.editor;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

import de.nordakademie.wpk.boerse.core.data.Depot;

public class DepotEditorInput implements IEditorInput {

	private Depot depot;

	public DepotEditorInput(Depot depot) {
		super();
		this.depot = depot;
	}

	public void setDepot(Depot depot) {
		this.depot = depot;
	}

	@Override
	public Object getAdapter(Class arg0) {
		return null;
	}

	@Override
	public boolean exists() {
		return false;
	}

	@Override
	public ImageDescriptor getImageDescriptor() {
		return null;
	}

	@Override
	public String getName() {
		return depot.getName();
	}

	@Override
	public IPersistableElement getPersistable() {
		return null;
	}

	@Override
	public String getToolTipText() {
		if (depot.getDescription() != null)
			return depot.getName() + " (" + depot.getDescription() + ")";
		return depot.getName();
	}

	public Depot getDepot() {
		return depot;
	}
}
